package com.jyh.demo.homework;

import java.util.Scanner;

public class Test1 {
    public static void main(String[] args) {
        System.out.println("请输入字符串：");
        String str = new Scanner(System.in).next();
        StringBuilder fanZhuan = new StringBuilder(str);
        //调用反转方法并转为字符串
        String s = fanZhuan.reverse().toString();
        System.out.println("录入的字符串："+str);
        System.out.println("反转的字符串："+s);
        System.exit(0);
    }
}
